<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><s:property value="#application.systemInfor.webName"/>－团购导航</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
        
		<script type="text/javascript" src="js/index.js"></script>
		
		<script type="text/javascript" src="js/tags.js"></script>
		<script type="text/javascript" src="js/times.js"></script>
		<script type="text/javascript" src="js/toupiao.js"></script>
		
		<script type="text/javascript">
		var n=4;
		   var keylis = new Array(${tags});
           
		</script>
		<script type="text/javascript" src="js/indexpicview.js"></script>
		
	</head>

	<body>
      
		<div class="container">
			<jsp:include page="head.jsp"/> 
			<div class="content">
                <div style="padding-top:20px;">
				
					  <div style="MARGIN: 0px; OVERFLOW: hidden; WIDTH: 915px; POSITION: relative; HEIGHT: 380px;">
						  <div id=l1 style="LEFT: 0px; POSITION: absolute; TOP: 0px">
						  <img id=img51 onclick="alert(1);"  height=380 src="uploadFile/ad/<s:property value="#application.systemInfor.adImage[0].split(',')[0]"/>" url="<s:property value="#application.systemInfor.adImage[0].split(',')[1]"/>" width=915  border=0 />
						  </div>
						  <div id=l2 style="LEFT: 915px; POSITION: absolute; TOP: 0px">
						    <img id=img52 onclick="alert(2);"  height=380 src="uploadFile/ad/<s:property value="#application.systemInfor.adImage[1].split(',')[0]"/>" url="<s:property value="#application.systemInfor.adImage[1].split(',')[1]"/>" width=915 border=0 />
						  </div>
						  <div id=l3 style="LEFT: 1830px; POSITION: absolute; TOP: 0px">
						   <img id=img53  height=380 src="uploadFile/ad/<s:property value="#application.systemInfor.adImage[2].split(',')[0]"/>" url="<s:property value="#application.systemInfor.adImage[2].split(',')[1]"/>" width=915  border=0 />
						  </div>
						  <div id=l4 style="LEFT: 2745px; POSITION: absolute; TOP: 0px">
						     <img id=img54 height=380 src="uploadFile/ad/<s:property value="#application.systemInfor.adImage[3].split(',')[0]"/>" url="<s:property value="#application.systemInfor.adImage[2].split(',')[1]"/>" width=915  border=0 /></a>
						  </div>
						  <div id=l0 style="Z-INDEX: 999999; LEFT: 0px; POSITION: absolute; TOP: 0px;">
						    <a href="javascript:void(0);" onclick="window.open(url)">
						    <!-- 
						    <img  onclick="window.open(url)" height=380 src="images/index_roll_bg.gif"  width=915 border=0 />
						     -->
						    </a>
						   </div>
						  
						  <div id=lfloat style="Z-INDEX: 9999999; LEFT: 720px; WIDTH: 250px; POSITION: absolute; TOP: 360px; HEIGHT: 15px">
							  
							    <img id=pnl1 onClick="javascript:picsw('l1');" style="BORDER-TOP-STYLE: none; MARGIN-RIGHT: 5px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" onmouseout=javascript:startauto(); height=15 src="images/pl1.gif" width=25 name=pnl1 />
							  
								<img id=pnl2 onClick="javascript:picsw('l2');" style="BORDER-TOP-STYLE: none; MARGIN-RIGHT: 5px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" onmouseout=javascript:startauto(); height=15 src="images/pl2a.gif" width=25 />
								
								<img id=pnl3 onClick="javascript:picsw('l3');"  style="BORDER-TOP-STYLE: none; MARGIN-RIGHT: 5px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" onmouseout=javascript:startauto(); height=15 src="images/pl3a.gif" width=25 />
								
								<img id=pnl4 onClick="javascript:picsw('l4');" style="BORDER-TOP-STYLE: none; MARGIN-RIGHT: 5px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" onmouseout=javascript:startauto(); height=15 src="images/pl4a.gif" width=25 />
						   </div>
					
			     </DIV>
			        
			         
			         
				</div>	
  
				<div class="navga">
					<div class="navga_left">
						<table width="557" border="0" align="center" cellpadding="0"
							cellspacing="0">
							 <tr>
							<s:iterator value="tags.split(',')" id="id" status="status">
							    <s:if test="#status.index<=27">
									<td height="35" align="center" valign="middle">
										<a href="groupby!getCityGroupbyList.action?cityId=<s:property value="#session.cityId"/>&currentPage=1&keyword=<s:property value="#id.substring(1,#id.length()-1)"/>" target="_parent"><s:property value="#id.substring(1,#id.length()-1)"/></a>
									</td>
									<s:if test="(#status.index+1)%7==0">
								      </tr> <tr>
								    </s:if>
							    </s:if>
							</s:iterator>
							
						</table>
					</div>
					<div class="navga_right">
					<form action="user/user!userLogin.action" method="post">
						<table width="243" border="0" align="center" cellpadding="0"
							cellspacing="0">
							<tr>
								<td width="54" height="35" align="right" valign="middle">
									EMAIL
								</td>
								<td height="35" colspan="2" align="center" valign="middle">
									<label>
										<input name="email" type="text" size="25" maxlength="50" />
									</label>
								</td>
							</tr>
							<tr>
								<td height="35" align="right" valign="middle">
									密码
								</td>
								<td height="35" colspan="2" align="center" valign="middle">
									<label>
										<input name="password" type="password" style="width:180px"  size="25" />
									</label>
								</td>
							</tr>
							<tr>
								<td height="35" align="right" valign="middle">
									<label>
										<input type="checkbox" name="save" value="yes" />
									</label>
								</td>
								<td height="35" colspan="2" align="center" valign="middle">
									在这台电脑上记住我
								</td>
							</tr>
							<tr>
								<td height="35" align="right" valign="middle">
									<a href="register.jsp">注册</a>
								</td>
								<td width="115" height="35" align="center" valign="middle">
									<a href="javascript:void(0)" onclick="login();">登陆</a>
								</td>
								<td width="74" height="35" align="center" valign="middle">
									<a href="findPassword.jsp">忘记密码</a>
								</td>
							</tr>
							
						</table>
						</form>
					</div>
					<div class="clear"></div>
				</div>

				<div class="lan2">
					<ul>
					  <s:iterator value="#request.categoryListAll" id="id" >   
					       <li>
							<a href="groupby!getCityGroupbyList.action?currentPage=1&cityId=<s:property value="cityId"/>&categoryId=<s:property value="id"/>"><s:property value="categoryName"/></a>
						   </li>
                       </s:iterator>
						
					</ul>
				</div>

              
				<div class="wrap">

                  <input type="hidden" id="url" value="groupby!getCityGroupbyList.action?cityId=<s:property value="cityId"/>&currentPage=1&keyword="/><!-- 供tags使用 -->
					<div class="left">
                        <s:iterator value="#request.groupbyTodayListAll" id="id" status="status" >
                              
                              <s:if test="#status.odd">
									<div class="box">
										<div class="box_top"></div>
										<div class="box_con">
											<div class="box_nei">
												<div class="t">
													<span class="tag" id='tags<s:property value="#status.index"/>'>
													 
													</span>
												</div>
												
											    
												<img src='<s:property value="#id[8]"/>' align='middle' class='img' />
												<span style="background-color: #ffffff; font-size: 12px;">现价:<span
													class="teshu"><s:property value="#id[2].substring(0,#id[2].length()-2)"/>元</span>&nbsp;原价:<span class="teshu"><s:property value="#id[3].substring(0,#id[3].length()-2)"/>元</span>&nbsp;折扣:<span
													class="teshu"><s:property value="#id[4]"/></span>&nbsp;节省:<span class="teshu"><s:property value="#id[5].substring(0,#id[5].length()-2)"/>元</span>
												    
												     <input type="hidden" id="b<s:property value="#status.index"/>end" value='<s:property value="#id[9]"/>'/>
												    
												<br />剩余时间:<span class="teshu" id="b<s:property value="#status.index"/>"></span>
												</span>
												<br />
												
												<s:if test="%{#id[1].length()>55}"> 
								                     <span id='t<s:property value="#status.index"/>' title='<s:property value="#id[1]" />' class="teshu2">&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[11]" escape="false" /><s:property value="#id[1].substring(0,55)+'...'" /></span>
											     </s:if> 
											     <s:else>
											        <span id='t<s:property value="#status.index"/>' title='<s:property value="#id[1]" />' class="teshu2">&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[11]" escape="false" /><s:property value="#id[1]" /></span>
											     </s:else>
												
												
												<br />
												<table width="100%" border="0" align="center" cellpadding="0"
													cellspacing="0" class="table">
													<tr>
														<td align="center" valign="middle">
															<a href="javascript:void(0);" onclick="addTop(<s:property value="#id[0]"/>,this);"><img src="images/ding.jpg" align="bottom" /></a>
														</td>
														<td align="center" valign="middle">
															<s:property value="#id[6]"/>人
														</td>
														<td align="center" valign="middle">
															<a href="groupbyCriticism!criticismGroupby.action?groupbyId=<s:property value="#id[0]"/>&currentPage=1&cityId=${cityId}"><img src="images/pinglun.jpg" /></a>
														</td>
														<td align="center" valign="middle">
															<s:property value="#id[7]"/>人
														</td>
														<td align="center" valign="middle">
															<a href="<s:property value="#id[10]"/>" target="_blank"><img src="images/anniu.jpg" /></a>
														</td>
			
													</tr>
												</table>
											</div>
										</div>
									</div>
                              </s:if>  
                              <s:if test="#status.even">
                                    
						         <div class="box1">
							       <div class="box_top"></div>
									<div class="box_con">
										<div class="box_nei">
											<div class="t">
												<span class="tag" id='tags<s:property value="#status.index"/>'>
												</span>
											</div>
											<img src="<s:property value="#id[8]"/>" align="middle" class="img" />
											<span style="background-color: #ffffff; font-size: 12px;">现价:<span
												class="teshu"><s:property value="#id[2].substring(0,#id[2].length()-2)"/>元</span>&nbsp;原价:<span class="teshu"><s:property value="#id[3].substring(0,#id[3].length()-2)"/>元</span>&nbsp;折扣:<span
												class="teshu"><s:property value="#id[4]"/></span>&nbsp;节省:<span class="teshu"><s:property value="#id[5].substring(0,#id[5].length()-2)"/>元</span>
												
												<input type="hidden" id="b<s:property value="#status.index"/>end" value='<s:property value="#id[9]"/>'/>
											<br />剩余时间:<span class="teshu" id="b<s:property value="#status.index"/>"></span>
											</span>
											<br />
											<s:if test="%{#id[1].length()>55}"> 
								                     <span id='t<s:property value="#status.index"/>' title='<s:property value="#id[1]" />' class="teshu2">&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[11]" escape="false" /><s:property value="#id[1].substring(0,55)+'...'" /></span>
											     </s:if> 
											     <s:else>
											        <span id='t<s:property value="#status.index"/>' title='<s:property value="#id[1]" />' class="teshu2">&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[11]" escape="false" /><s:property value="#id[1]" /></span>
											     </s:else>
											
											<br />
											<table width="100%" border="0" align="center" cellpadding="0"
												cellspacing="0" class="table">
												<tr>
													<td align="center" valign="middle">
														<a href="javascript:void(0);" onclick="addTop(<s:property value="#id[0]"/>,this)"><img src="images/ding.jpg" align="bottom" /></a>
													</td>
													<td align="center" valign="middle">
														<s:property value="#id[6]"/>人
													</td>
													<td align="center" valign="middle">
														<a href="groupbyCriticism!criticismGroupby.action?groupbyId=<s:property value="#id[0]"/>&currentPage=1&cityId=${cityId}"><img src="images/pinglun.jpg" /></a>
													</td>
													<td align="center" valign="middle">
														<s:property value="#id[7]"/>人
													</td>
													<td align="center" valign="middle">
														<a href="<s:property value="#id[10]"/>" target="_blank"><img src="images/anniu.jpg" /></a>
													</td>
		
												</tr>
											</table>
										</div>
									</div>
								</div>
                              </s:if>
                        </s:iterator>

						<div class="ye">
						    
						    <s:if test="#request.groupbyTodayListAll.size()!=0">
						    
						    <s:set name="pageUrl" >groupby!index.action?cityId=${cityId}&currentPage=</s:set>
							<a href="${pageUrl}1">第一页</a>&nbsp;&nbsp;<a href="${pageUrl}<s:property value="#request.pages.prePage"/>">上一页</a>
							  
							   <s:set name="totalPage" value="#request.pages.totalPage"></s:set>
							   
							   <s:set name="currentPage" value="#request.pages.currentPage"></s:set>
							   <s:if test="#currentPage<=0">
							      <s:set name="currentPage" value="1"></s:set>
							   </s:if>
							   <s:elseif test="#currentPage>#totalPage">
							      <s:set name="currentPage" value="#totalPage"></s:set>
							   </s:elseif>
							   
							   <s:if test="#totalPage%8>0">
							       <s:set name="pageSize" value="#totalPage/8+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="pageSize" value="#totalPage/8"></s:set>
							   </s:else>
							  
							   
							   <s:if test="#currentPage%8>0">
							       <s:set name="cPageSize" value="#currentPage/8+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="cPageSize" value="#currentPage/8"></s:set>
							   </s:else>
							   
							   <s:set name="first" value="8*(#cPageSize-1)"></s:set>
							   <s:if test="#first==0">
							      <s:set name="first" value="1"></s:set>
							   </s:if>
							   <s:set name="last" value="#cPageSize*8"></s:set>
							   <s:if test="#last>#totalPage">
							      <s:set name="last" value="#totalPage"></s:set>
							   </s:if>
				
							     <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="#first"/>
							       <s:param name="last" value="#last" />
							       <s:iterator status="status"> 
							         <s:if test="#currentPage==(#status.index+#first)">
							            &nbsp;&nbsp;<s:a href="%{pageUrl}%{#status.index+#first}" cssStyle="background-color:#982987;color:#FFFFFF; padding-right:3px; padding-left:3px;" ><s:property value="#status.index+#first" /></s:a>
							         </s:if>
							         <s:else>
							            &nbsp;&nbsp;<s:a href="%{pageUrl}%{#status.index+#first}" ><s:property value="#status.index+#first" /></s:a>
							         </s:else>
							          
							       </s:iterator> 
							     </s:bean>
							     <s:if test="#last<#totalPage">
							       ......&nbsp;
							     </s:if>
							<a href="${pageUrl}<s:property value="#request.pages.nextPage"/>">下一页</a>&nbsp;&nbsp;<a href="${pageUrl}<s:property value="#request.pages.totalPage"/>">最后一页</a>
						    </s:if>
						</div>
					</div>

					<div class="right">
						<a href="<s:property value="#application.systemInfor.adImage[4].split(',')[1]"/>" target="_blank">
						<img src="uploadFile/ad/<s:property value="#application.systemInfor.adImage[4].split(',')[0]"/>" width="300" height="188"  class="tu" />
                        </a>
                        <a href="<s:property value="#application.systemInfor.adImage[5].split(',')[1]"/>" target="_blank">
						<img src="uploadFile/ad/<s:property value="#application.systemInfor.adImage[5].split(',')[0]"/>" width="300" height="188" class="tu" />
						 </a>
						<div class="box2">
							<div class="box2_top">
								<a  target="_parent">优买排行</a>
							</div>
							<div class="box2_con">
								<ul class="bo">
								   <s:iterator value="#request.groupbyBefore" id="id" status="status">
								      <s:if test="#status.index==4">
								          <li class="no">
								      </s:if>
								      <s:else>
								           <li >
								      </s:else>
								        
											<div class="pic2">
												<a href="<s:property value="#id.dealUrl"/>" target="_blank"><img src="<s:property value="#id.image"/>" width="67" height="45" align="middle" /></a>
											</div>
											<div class="info2">
											<a href="<s:property value="#id.dealUrl"/>" target="_blank">
												&nbsp;&nbsp;&nbsp;&nbsp;
												<s:if test="%{#id.title.length()>60}"> 
                                                   <s:property value="#id.title.trim().substring(0,60)+'...'" />
											     </s:if> 
											     <s:else>
											        <s:property value="#id.title.trim()" />
											     </s:else>
											     </a>
											</div>
											<div class="clear"></div>
									   </li>
								   </s:iterator>
								</ul>
							</div>

						</div>

						<!--------------------------------end box2------------------------------------>

						<div class="box2">
							<div class="box2_top">
								<a >最新评论</a>
							</div>
							<div class="box2_con">
								<ul class="ul2">
								   <s:iterator value="#request.groupbyCriticismList" id="id" status="status">
									  
					                      <s:set name="urlContent">user/groupbyCriticism!criticismGroupby.action?groupbyId=<s:property value="#id[7]"/>&currentPage=1&cityId=<s:property value="#session.cityId"/></s:set>
									   <s:if test="#id[6]==2">
					                      <s:set name="url">user/user!singleUserPage.action?currentPage=1&userId=<s:property value="#id[5]"/></s:set>
									   </s:if>
									   <s:elseif test="#id[6]==3">
									      <s:set name="url">user/user!groupbyUserPage.action?currentPage=1&userId=<s:property value="#id[5]"/></s:set>
									   </s:elseif>
									   <s:elseif test="#id[6]==4">
									      <s:set name="url">user/user!brandUserPage.action?currentPage=1&userId=<s:property value="#id[5]"/></s:set>
									   </s:elseif>
							           
								       <li onmouseover="showdel(this,<s:property value="#id[5]"/>,<s:property value="#id[0]"/>)" 
								           onmouseout="removedel(<s:property value="#id[0]"/>)">
										<div class="pic">
										   <a href="<s:property value="url"/>">
											<s:if test="#id[3].equals('')">
					                 			<img src="uploadFile/img.gif" width=60 height=60/>
								            </s:if>
								            <s:else>
								                 <img src="uploadFile/<s:property  value="#id[3]"/>" width=60 height=60/>
								            </s:else>
								            </a>
										</div>
										<div class="info">
											<div class="xin">
												<table width="100%" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td width="65%" align="left" valign="middle">
															&nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[2]"/>:<a href="<s:property value="url"/>" class="ziti"><s:property value="#id[4]"/></a>
														</td>
														
													</tr>

												</table>

											</div>
											<a href="<s:property value="urlContent"/>">
											<s:if test="%{#id[1].length()>50}">
											    &nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[1].substring(0,50)"/>...
											</s:if>
											<s:else>
											    &nbsp;&nbsp;&nbsp;&nbsp;<s:property value="#id[1]"/>
											</s:else>
											</a>
										</div>
										<!--end info-->
										<div class="clear"></div>
									  </li>
									 
								   </s:iterator>
									
								</ul>
							</div>
						</div>



						<!---------------------end box2-------------------------------------------------------->


					</div>

					<div class="clear"></div>



				</div>


			</div>


			<div id="foot">
				
				<jsp:include page="bot.jsp"></jsp:include>
			</div>

		</div>
		
		<input type="hidden" id="legnth" value='<s:property value="#request.groupbyTodayListAll.size()"/>'/>
	</body>
</html>
 <script > 
  
  var legnth=$("#legnth").val();
  var tagsId=[];
  for(var i=0;i<legnth;i++)
  {
    tagsId.push("tags"+i+",t"+i);
    GetRTime("b"+i,"b"+i+"end");
  }
  lastIndexDemo(tagsId);
 </script>
